{% load staticfiles %}
<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title>产品列表</title>
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
    <script src="{% static 'js/jquery.min.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
</head>
<body>
<div id="legend" class="">
  <legend class="">产品列表&nbsp;&nbsp;<a href="{% url 'add' %}"><small>添加</small></a></legend>
</div>
<table class="table table-hover">
   <thead>
      <tr>
         <th>产品名称</th>
         <th>产品型号</th>
         <th>产品类别</th>
          <th>库存数量</th>
         <th>产品价格</th>
          <th>操作</th>

      </tr>
   </thead>
   <tbody>
   {% for product in products %}
      <tr>
         <td>{{ product.name }}</td>
         <td>{{ product.get_spec_display }}</td>
         <td>{{ product.cate }}</td>
        <td>{{ product.stock }}</td>
         <td>{{ product.price }}</td>
        <td><a href="{% url 'update' product.id%}">修改</a>|
            <a href="{% url 'delete' product.id%}">删除</a></td>

      </tr>
   {% endfor %}
   </tbody>
</table>
<ul class="pager">
    {{ products.number }}/{{ products.paginator.num_pages }}
  {% if products.has_previous %}
  <li><a href="?page={{ products.previous_page_number }}">上一页</a></li>
  {% endif %}
    {% if products.has_next %}
  <li><a href="?page={{ products.next_page_number }}">下一页</a></li>
    {% endif %}
</ul>
</body>
</html>